import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class JrEmpty extends StatelessWidget {
  final String? text;
  final double iconSize;
  final Color bgColor;

  const JrEmpty({
    super.key,
    this.text,
    this.iconSize = 150,
    this.bgColor = Colors.transparent,
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        color: bgColor,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Image(
              image: const AssetImage('assets/images/icon_rails.png'),
              width: iconSize,
              height: iconSize,
            ),
            if (text != null)
              Container(
                margin: EdgeInsets.only(top: 24.h),
                child:
                    Text(text!, textAlign: TextAlign.center, style: const TextStyle(fontSize: 16, color: Colors.white)),
              ),
          ],
        ),
      ),
    );
  }
}
